#ifndef _H_DEF_MSG_CLIENT_H 
#define _H_DEF_MSG_CLIENT_H

#include "commdef.h"






#define	MSG_CLIENT_SUCCESS			0
#define MSG_CLIENT_INVALID_PARAM	1
#define MSG_CLIENT_MEMORY			2
#define MSG_CLIENT_INVALID_HANDLE	3
#define MSG_CLIENT_ERROR4			4
#define MSG_CLIENT_ERROR5			5

#define MSG_CLIENT_API_LIBVERSION	6
	

#define MSG_C_Could_not_open_pipe		8	
#define MSG_C_SetNamedPipeHandleState	9	
#define MSG_C_WriteFile2PIPE			10
#define MSG_C_WritePipeSize				11
#define MSG_C_OPEN_NOTOK				12
#define MSG_C_AUTH_FAILED				13


//=------------------------------------------------------
#define MSG_SERVER_ERROR				0x01000000


#define MSG_C_NO_SERVER				(MSG_SERVER_ERROR | 1)
#define MSG_C_SVR_TIMEOUT			(MSG_SERVER_ERROR | 2)


#define MSG_SERVER_NO_THREAD		(MSG_SERVER_ERROR | 233)





typedef struct _ST_PIPE_client
{
	DWORD			dwsize;			
	HANDLE			hPipe;
	DWORD			dwstatus;
	DWORD			dwclientID;
	ST_AUTH_TOKEN	auth_token;

}ST_PIPE_client,*PST_PIPE_client;





#ifdef __cplusplus
extern "C" {
#endif 

DWORD WINAPI msgclient_open(ST_PIPE_client *stc_context,UINT nSize);
DWORD WINAPI msgclient_close(ST_PIPE_client *stc_context);
DWORD WINAPI msgclient_pipe
(
 IN ST_PIPE_client *stc_context,
 IN void *psend,size_t nsize_send,
 OUT void *previce,size_t nsize_revice,unsigned int *lpnretsize
);

#ifdef __cplusplus
};
#endif 

#endif	//_H_DEF_MSG_CLIENT_H